package com.caiyi.financial.nirvana.sms.controller;


import com.caiyi.financial.nirvana.sms.entity.SmsMsg;
import com.caiyi.financial.nirvana.sms.querybean.QueryMsgBean;
import com.caiyi.financial.nirvana.sms.service.SmsMsgService;
import com.youyu.common.api.Result;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(description = "发送记录接口")
@RestController
@CrossOrigin
@RequestMapping("sms/sendDetails")
public class SendDetailsController extends BaseController {

    @Autowired
    private SmsMsgService msgService;

    @ApiOperation(value = "根据params查找Msg详情", notes = "根据params查找Msg详情描述")
    @ApiResponses({@ApiResponse(code = 0000, message = "成功", response = SmsMsg.class),
            @ApiResponse(code = 9999, message = "失败", response = String.class)})
    @PostMapping("/getMsgByParams")
    public Result getMsgByParams(@RequestBody @ApiParam(name = "bean", value = "查找短信参数", required = true) QueryMsgBean bean) {
        bean.setAccount(smsUser.getAccount());
        return Result.ok(msgService.getMsgByParams(bean));
    }
}
